<?php
/**
 * Title
 * Created by Jason.
 * User: Administrator
 * Date: 2019/12/7 0007
 * Time: 下午 5:07
 */

namespace app\index\abstracts;


use app\index\interfaces\Observer;

abstract class EventGenerator
{
    private $observers = array();

    public function addObserver(Observer $observer)
    {
        $this->observers[] = $observer;
    }

    public function notify(){
        foreach ($this->observers as $observer){
            $observer->sendMsg();
        }
    }
}